<?php
namespace Application\Model;
use Buzz\Client\Curl;
use Payum\Core\Extension\StorageExtension;
use Payum\Paypal\ExpressCheckout\Nvp\PaymentFactory;
use Payum\Paypal\ExpressCheckout\Nvp\Api;
use Payum\Core\Registry\SimpleRegistry;
use Payum\Core\Storage\FilesystemStorage;
use Payum\Core\Security\PlainHttpRequestVerifier;

$tokenStorage = new FilesystemStorage('/path/to/storage', 'Application\Model\PaymentSecurityToken');
$requestVerifier = new PlainHttpRequestVerifier($tokenStorage);

$detailsClass = 'Application\Model\PaymentDetails';

$storages = array(
		'paypal' => array(
				$detailsClass => new FilesystemStorage('/path/to/storage', $detailsClass)
		)
);

$payments = array(
		'paypal' => PaymentFactory::create(new Api(new Curl, array(
				'username' => 'matocnhoi_api1.gmail.com',
				'password' => '4AAZ2NVRFXVUVL69',
				'signature' => 'AIi8ckTk8yeIB-BXllKV.BBU0ARzAgTUm8kpEB7BaRC9hK4z6fDOFue3',
				'sandbox' => true
		)
		)));

$registry = new SimpleRegistry($payments, $storages, null, null);
$registry->registerStorageExtensions();